import request from '@/utils/request'
// import {exportMethod} from '@/utils/utils'
import * as proxy from '@/constants/proxy'
import { exportMethod } from '@/utils/utils'
import { CHECC_API_CMS } from '@/constants/proxy'

// 列表数据
export function getTable(params: any) {
    return request({
      url: proxy.CHECC_API_CMS +  '/kjsl/tresult/patent/list',
      method: 'post',
      params
    })
  }
// 解锁
export function getUnlock(data: any) {
    return request({
        url: proxy.CHECC_API_CMS +  '/kjsl/tresult/patent/unlock/' + data,
        method: 'get',
        })
    }
// 锁定
export function getLock(data: any) {
    return request({
        url: proxy.CHECC_API_CMS +  '/kjsl/tresult/patent/lock/' + data,
        method: 'get',
        })
    }
//-------------下载模板
export function downMb() {
  const params = {
    url: proxy.CHECC_API_CMS + '/khgl/question/download',
    method:'get',
    fileName: '模板实例',
   }
  return exportMethod(params)
}
//导出
export function getExport(data: any,fileName) {
    const params = {
      method:'post',
      url: proxy.CHECC_API_CMS + '/kjsl/tresult/patent/export',
      data,
      fileName
    }
    return exportMethod(params)
  }
//批量删除
export const getDelect = (data: string[]) =>
  request({
    url: proxy.CHECC_API_CMS+ `/kjsl/tresult/patent/delete/`+ data,
    method: 'delete',
})
//确认
export function getConfirm(data: any) {
    return request({
      url: proxy.CHECC_API_CMS +  '/kjsl/tresult/patent/confirm',
      method: 'post',
      data
    })
}
//保存基本信息
export function addInformation(data: any) {
  return request({
    url: proxy.CHECC_API_CMS +  '/kjsl/tresult/patent/addBaseInfo',
    method: 'post',
    data
  })
}
//全部机构单位
export function getUnit(data: any) {
  return request({
    url: proxy.CHECC_API_CMS +  '/org/selectTreeByLoginOrg',
    method: 'get',
  })
}

//编辑回显
export function getDetailById(data: any) {
  return request({
    url: proxy.CHECC_API_CMS +  '/kjsl/tresult/patent/getDetailById/' + data,
    method: 'get',
  })
}
//编辑
export function getUpdate(data: any) {
  return request({
    url: proxy.CHECC_API_CMS +  '/kjsl/tresult/patent/updateInfo',
    method: 'post',
    data
  })
}
//-------------------------------------------------第二页
//列表
export function getTable2(params: any) {
  return request({
    url: proxy.CHECC_API_CMS +  '/kjsl/PatentQualityEvaluation/list',
    method: 'post',
    params
  })
}
//导出2
export function getExport2(data: any,fileName) {
  const params = {
    method:'post',
    url: proxy.CHECC_API_CMS + '/kjsl/PatentQualityEvaluation/export',
    data,
    fileName
  }
  return exportMethod(params)
}
//-------------上传模板
export function importMb(data: any) {
  return request({
    url: proxy.CHECC_API_CMS +  '/kjsl/PatentQualityEvaluation/importPaten',
    method: 'post',
    data
  })
}//-------------上传模板
export function importMbtwo(data: any) {
  return request({
    url: proxy.CHECC_API_CMS +  '/kjsl/tresult/patent/importPatentExcel',
    method: 'post',
    data
  })
}
//-------------质量详情
export function getDetailById2(params: any) {
  return request({
    url: proxy.CHECC_API_CMS +  '/kjsl/PatentQualityEvaluation/getDetailById',
    method: 'post',
    params
  })
}
//保存2
export function addInformation2(data: any) {
  return request({
    url: proxy.CHECC_API_CMS +  '/kjsl/PatentQualityEvaluation/update',
    method: 'post',
    data
  })
}
